﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WPF基础.Pages;

namespace WPF基础.控件
{
    /// <summary>
    /// A10_Frame.xaml 的交互逻辑
    /// </summary>
    public partial class A10_Frame : Window
    {
        public A10_Frame()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //1.使用source 
            //this.MyFrame.Source = new Uri("https://www.bilibili.com", UriKind.Absolute);
            //this.MyFrame.Source = new Uri(@"../Pages/Page_Test.xaml", UriKind.Relative);

            //2.使用Navigate跳转
            Page_Test Pages = new Page_Test();
            this.MyFrame.Navigate(Pages,"参数");

            //3.
            //this.MyFrame.Navigate(new Uri("../Pages/Page_Test.xaml", UriKind.Relative));
        }

        private void MyFrame_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
        {
            object extraData = e.ExtraData;
            Console.WriteLine(extraData);
        }
    }
}
